
#define _ENABLE_ATOMIC_ALIGNMENT_FIX  //表示当前vs大于等于 vs2015
#include <atomic>
#include <thread>



struct testStruct
{
	int i;
	int j;

};

atomic<testStruct>    vecatomic;
void testfun1()
{
	for (int i = 0; i < 1000; i++)
	{
		testStruct curr = vecatomic.load();
		curr.j = i;
		//	vecatomic.store(std::move(curr));
			vecatomic.store(curr);
	}
	
}


int main()
{
	atomic<testStruct>    vecatomic;

	vector<int>      vec_no_atomic;


	thread ss12(testfun1);  ///线程绑定的函数的参数似乎不能传引用
	thread ss14(testfun1);
}